package time;

import java.util.Random;

public class RandomImageGenerator {
	//创建Random对象
	 static Random random=new Random();
	 //随机生成包含验证码字符串
	 public static String random(int num){
	  //初始化种子
	  String[] str={"0","1","2","3","4","5","6","7","8","9",
	       "a","b","c","d","e","f","g","h","i","j",
	       "k","l","m","n","p","q","r","s","t"};
	  int number=str.length;
	  //接收随机字符
	  String text = "";
	  //随机产生4个字符的字符串
	  for(int i=0;i<num;i++){
	   text+=str[random.nextInt(number)];
	  }
	  return text;
 }
}
